package com.seafwg.educms.controller;


import com.seafwg.commonutils.R;
import com.seafwg.educms.entity.CrmBanner;
import com.seafwg.educms.service.CrmBannerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 首页banner表 前端显示部分
 * </p>
 *
 * @author seafwg
 * @since 2021-04-01
 */
@RestController
@CrossOrigin
@Api(value = "首页banner表 前端显示部分")
@RequestMapping("/educms/bannerfront")
public class BannerFrontController {
    @Autowired
    private CrmBannerService crmBannerService;

    /**
     * 查询所有banner
     * @return
     */
    @ApiOperation(value = "查询所有banner")
    @GetMapping("/getAllBanner")
    public R getAllBanner() {
        List<CrmBanner> list = crmBannerService.selectAllBanner();
        return R.ok().data("list", list);
    }

}

